{extend name="property/public/insidePageBase" /}
{block name="title"}标签详情{/block}
{block name="body"}
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-form  layui-form-pane">
            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                <div class="layui-tab layui-tab-brief">
                    <!--基本信息 add-->
                    <ul class="layui-tab-title">
                        <li class="layui-this">{$info['full_unit_name'] ?? ''} 房源列表</li>
                    </ul>
                    <table class="layui-hide" id="roomBasicList" lay-filter="roomBasicList"></table>
                    <script type="text/html" id="contract_status_tpl">
                        {{# if(d.contract_status === 1) { }}
                        <span class="layui-badge layui-bg-orange">待审核</span>
                        {{# }else if (d.contract_status === 2) { }}
                        <span class="layui-badge layui-bg-blue">进行中</span>
                        {{# } else { }}
                        <span>---</span>
                        {{# } }}

                        {{# if( d.status == 2) { }}
                        {{# if(d.contract_end_date) { }}{{d.contract_end_date}} 到期{{# } }}
                        剩余<span style="color: red;"> {{ d.lave_days }} </span>天
                        {{# } }}
                    </script>
                    <!--基本信息 add-->
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="js"}
{__block__}
<script>
    layui.use(['laydate','table','upload'], function () {
        var laydate = layui.laydate, table = layui.table,upload = layui.upload;
        let unitId = {$info['id']};
        // 物业列表 add
        var tableIdRoomBasicList = 'roomBasicList';
        table.render({
            elem: '#'+tableIdRoomBasicList,
            id:tableIdRoomBasicList,
            url: '{:url("propertyRoomBasicList")}?unit_id='+unitId,
            cols: [[
                {type: "checkbox", width: 50},
                {field: 'room_name', width: 228, title: '房间名称', templet:'#room_name_tpl'},
                {field: 'room_size', width: 106, title: '房间面积', templet:function(d) {
                        return d.room_size + ' m²';
                    },sort: true},
                {field: 'room_rent', width: 128, title: '租金/月', templet:function(d) {
                        return d.room_rent + ' ¥';
                    },sort: true},
                {field: 'room_deposit', width: 118, title: '房间押金', templet:function(d) {
                        return d.room_deposit + ' ¥';
                    },sort: true},
                {field: 'contract_status', width: 278, title: '租赁到期时间', templet:'#contract_status_tpl', sort: true},
            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 15,
            page: true,
            height: 'full-100'
        });
        // 物业列表 end
    });
</script>
{/block}